//定义组件
define(function (require, exports, module) {

    var _ = require("lib/lodash.js");

    var ajaxOption = {
        type: 'POST',
        url: gMain.apiUrl + "/article/getList?token=11",
        data: {

        },
        dataType: 'json',
        contentType: "application/json",
        //contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
        success: function () {

        }
    };

    var api = {
        //后期直接变成ajax
        getArtList: function (option) {

            ajaxOption.url = gMain.apiUrl + "/article/getArtViewList";
            var option = $.extend({}, ajaxOption, option);
            option.data = JSON.stringify(option.data);
            $.ajax(option);
        },
        getArtPartList: function (option) {
            ajaxOption.url = gMain.apiUrl + "/articlePart/getList";
            var option = $.extend({}, ajaxOption, option);
            option.data = JSON.stringify(option.data);
            // option.data = option.data;
            $.ajax(option);
        },
        getArtSimpleMod: function (option) {
            //$.ajax(option);
            return data.ArtSimpleMod;
        },
        queryCategoryList: function (option) {
            ajaxOption.url = gMain.apiUrl + "/category/getList";
            var option = $.extend({}, ajaxOption, option);

            option.data = JSON.stringify(option.data);

            option.data = option.data
            $.ajax(option);
        },
        queryCategoryTreeList: function (option) {
            return option.callBack(data.CategoryaTreeList);
        },
        saveArtPart: function (option) {
            ajaxOption.url = gMain.apiUrl + "/articlePart/ArtPartEdit?toDelIds=" + option.toDelIds;
            var option = $.extend({}, ajaxOption, option);
            option.data = JSON.stringify(option.data);
            $.ajax(option);
        },
        updateArtPart: function (option) {
            ajaxOption.url = gMain.apiUrl + "/articlePart/update";
            var option = $.extend({}, ajaxOption, option);
            option.data = JSON.stringify(option.data);
            $.ajax(option);
        }

    };

    var data = {
        ArtList: [{
            id: '1',
            title: 'OBA，这个星球属于我！',
            summary: '我心中的演员表（暂定，因为心里总是轮番让这几个人试戏，所以总是有变动，但是蓝冥睿的位置却是一直没动过滴呵呵呵嘎嘎嘎',
            parentCategoryId: 1,
            parentCategoryName: '女生频道',
            categoryId: 6,
            categoryName: '幻想言情',
            dataFlag: 1
        },
        {
            id: '2',
            title: '宁负苍天',
            summary: '我心中的演员表（暂定，因为心里总是轮番让这几个人试戏，所以总是有变动，但是蓝冥睿的位置却是一直没动过滴呵呵呵嘎嘎嘎',
            parentCategoryId: 1,
            parentCategoryName: '女生频道',
            categoryId: 7,
            categoryName: '现代言情',
            dataFlag: 1
        }, {
            id: '3',
            title: '傲女天下',
            summary: '我心中的演员表（暂定，因为心里总是轮番让这几个人试戏，所以总是有变动，但是蓝冥睿的位置却是一直没动过滴呵呵呵嘎嘎嘎',
            parentCategoryId: 1,
            parentCategoryName: '男生频道',
            categoryId: 14,
            categoryName: '仙侠武侠',
            dataFlag: 0
        }],
        ArtSimpleMod: {
            id: '3',
            title: '傲女天下',
            summary: '我心中的演员表（暂定，因为心里总是轮番让这几个人试戏，所以总是有变动，但是蓝冥睿的位置却是一直没动过滴呵呵呵嘎嘎嘎',
            categoryId: 3,
            categoryName: '立方停车',
            dataFlag: 1
        },
        CategoryList: [{
            id: 1,
            name: '女生频道',
            pId: 0
        }, {
            id: 2,
            name: '男生频道',
            pId: 0
        }, {
            id: 3,
            name: '精口文学',
            pId: 0
        },
        {
            id: 4,
            name: '影视出版',
            pId: 0
        },
        {
            id: 5,
            name: '二次元',
            pId: 0
        }, {
            id: 6,
            name: '幻想言情',
            pId: 1
        }, {
            id: 7,
            name: '现代言情',
            pId: 1
        }],
        CategoryaTreeList: [{
            id: 1,
            label: '女生频道',
            pId: 0,
            children: [{
                id: 6,
                label: '幻想言情',
                pId: 1
            }, {
                id: 7,
                label: '现代言情',
                pId: 1
            }]
        }, {
            id: 2,
            label: '男生频道',
            pId: 0
        }, {
            id: 3,
            label: '精口文学',
            pId: 0
        },
        {
            id: 4,
            label: '影视出版',
            pId: 0
        },
        {
            id: 5,
            label: '二次元',
            pId: 0
        }]

    };

    module.exports = api;

});